added a function to perform a binary version check, returning a static
authorTim Janik <timj@gtk.org>
Fri, 21 Aug 1998 02:22:06 +0000 (02:22 +0000)
committerTim Janik <timj@src.gnome.org>
Fri, 21 Aug 1998 02:22:06 +0000 (02:22 +0000)
Fri Aug 21 02:31:26 1998  Tim Janik  <timj@gtk.org>

        * gtk/gtkmain.h:
        * gtk/gtkmain.c (gtk_check_version): added a function to perform a
        binary version check, returning a static string for error descriptions,
        or NULL on success.

ChangeLog
ChangeLog.pre-2-0
ChangeLog.pre-2-10
ChangeLog.pre-2-2
ChangeLog.pre-2-4
ChangeLog.pre-2-6
ChangeLog.pre-2-8
gtk/gtkmain.c
gtk/gtkmain.h

index c1eb6e6bc5f231cfde2f1429b75fc9f61dda15ca..dd888d9c79f1c498e768b88a81d978c9c86bab7c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,9 +1,16 @@
+Fri Aug 21 02:31:26 1998  Tim Janik  <timj@gtk.org>
+
+       * gtk/gtkmain.h:
+       * gtk/gtkmain.c (gtk_check_version): added a function to perform a
+       binary version check, returning a static string for error descriptions,
+       or NULL on success.
+
 Thu Aug 20 20:08:15 1998  Owen Taylor  <otaylor@redhat.com>
 
        * gtk/gtktext.c ([un]draw_cursor): Check to see if we've
        computed our geometry yet, and if not, ignore the request.
 
-         gtk/gtktext.c (correct_cache_insert): Fiddled around]
+       * gtk/gtktext.c (correct_cache_insert): Fiddled around
        some more. All the bug-test codes seem to work at once
        now. (fingers crossed...)
 
index c1eb6e6bc5f231cfde2f1429b75fc9f61dda15ca..dd888d9c79f1c498e768b88a81d978c9c86bab7c 100644 (file)
@@ -1,9 +1,16 @@
+Fri Aug 21 02:31:26 1998  Tim Janik  <timj@gtk.org>
+
+       * gtk/gtkmain.h:
+       * gtk/gtkmain.c (gtk_check_version): added a function to perform a
+       binary version check, returning a static string for error descriptions,
+       or NULL on success.
+
 Thu Aug 20 20:08:15 1998  Owen Taylor  <otaylor@redhat.com>
 
        * gtk/gtktext.c ([un]draw_cursor): Check to see if we've
        computed our geometry yet, and if not, ignore the request.
 
-         gtk/gtktext.c (correct_cache_insert): Fiddled around]
+       * gtk/gtktext.c (correct_cache_insert): Fiddled around
        some more. All the bug-test codes seem to work at once
        now. (fingers crossed...)
 
index c1eb6e6bc5f231cfde2f1429b75fc9f61dda15ca..dd888d9c79f1c498e768b88a81d978c9c86bab7c 100644 (file)
@@ -1,9 +1,16 @@
+Fri Aug 21 02:31:26 1998  Tim Janik  <timj@gtk.org>
+
+       * gtk/gtkmain.h:
+       * gtk/gtkmain.c (gtk_check_version): added a function to perform a
+       binary version check, returning a static string for error descriptions,
+       or NULL on success.
+
 Thu Aug 20 20:08:15 1998  Owen Taylor  <otaylor@redhat.com>
 
        * gtk/gtktext.c ([un]draw_cursor): Check to see if we've
        computed our geometry yet, and if not, ignore the request.
 
-         gtk/gtktext.c (correct_cache_insert): Fiddled around]
+       * gtk/gtktext.c (correct_cache_insert): Fiddled around
        some more. All the bug-test codes seem to work at once
        now. (fingers crossed...)
 
index c1eb6e6bc5f231cfde2f1429b75fc9f61dda15ca..dd888d9c79f1c498e768b88a81d978c9c86bab7c 100644 (file)
@@ -1,9 +1,16 @@
+Fri Aug 21 02:31:26 1998  Tim Janik  <timj@gtk.org>
+
+       * gtk/gtkmain.h:
+       * gtk/gtkmain.c (gtk_check_version): added a function to perform a
+       binary version check, returning a static string for error descriptions,
+       or NULL on success.
+
 Thu Aug 20 20:08:15 1998  Owen Taylor  <otaylor@redhat.com>
 
        * gtk/gtktext.c ([un]draw_cursor): Check to see if we've
        computed our geometry yet, and if not, ignore the request.
 
-         gtk/gtktext.c (correct_cache_insert): Fiddled around]
+       * gtk/gtktext.c (correct_cache_insert): Fiddled around
        some more. All the bug-test codes seem to work at once
        now. (fingers crossed...)
 
index c1eb6e6bc5f231cfde2f1429b75fc9f61dda15ca..dd888d9c79f1c498e768b88a81d978c9c86bab7c 100644 (file)
@@ -1,9 +1,16 @@
+Fri Aug 21 02:31:26 1998  Tim Janik  <timj@gtk.org>
+
+       * gtk/gtkmain.h:
+       * gtk/gtkmain.c (gtk_check_version): added a function to perform a
+       binary version check, returning a static string for error descriptions,
+       or NULL on success.
+
 Thu Aug 20 20:08:15 1998  Owen Taylor  <otaylor@redhat.com>
 
        * gtk/gtktext.c ([un]draw_cursor): Check to see if we've
        computed our geometry yet, and if not, ignore the request.
 
-         gtk/gtktext.c (correct_cache_insert): Fiddled around]
+       * gtk/gtktext.c (correct_cache_insert): Fiddled around
        some more. All the bug-test codes seem to work at once
        now. (fingers crossed...)
 
index c1eb6e6bc5f231cfde2f1429b75fc9f61dda15ca..dd888d9c79f1c498e768b88a81d978c9c86bab7c 100644 (file)
@@ -1,9 +1,16 @@
+Fri Aug 21 02:31:26 1998  Tim Janik  <timj@gtk.org>
+
+       * gtk/gtkmain.h:
+       * gtk/gtkmain.c (gtk_check_version): added a function to perform a
+       binary version check, returning a static string for error descriptions,
+       or NULL on success.
+
 Thu Aug 20 20:08:15 1998  Owen Taylor  <otaylor@redhat.com>
 
        * gtk/gtktext.c ([un]draw_cursor): Check to see if we've
        computed our geometry yet, and if not, ignore the request.
 
-         gtk/gtktext.c (correct_cache_insert): Fiddled around]
+       * gtk/gtktext.c (correct_cache_insert): Fiddled around
        some more. All the bug-test codes seem to work at once
        now. (fingers crossed...)
 
index c1eb6e6bc5f231cfde2f1429b75fc9f61dda15ca..dd888d9c79f1c498e768b88a81d978c9c86bab7c 100644 (file)
@@ -1,9 +1,16 @@
+Fri Aug 21 02:31:26 1998  Tim Janik  <timj@gtk.org>
+
+       * gtk/gtkmain.h:
+       * gtk/gtkmain.c (gtk_check_version): added a function to perform a
+       binary version check, returning a static string for error descriptions,
+       or NULL on success.
+
 Thu Aug 20 20:08:15 1998  Owen Taylor  <otaylor@redhat.com>
 
        * gtk/gtktext.c ([un]draw_cursor): Check to see if we've
        computed our geometry yet, and if not, ignore the request.
 
-         gtk/gtktext.c (correct_cache_insert): Fiddled around]
+       * gtk/gtktext.c (correct_cache_insert): Fiddled around
        some more. All the bug-test codes seem to work at once
        now. (fingers crossed...)
 
index b2b8e1f203674f29e42b1434c7e7d631b2ded489..2d674765631297788b6d0198db4b2d929216a80b 100644 (file)
@@ -135,6 +135,7 @@ static gint  gtk_idle_compare                (gconstpointer      a,
 static gint  gtk_timeout_compare        (gconstpointer      a, 
                                          gconstpointer      b);
 
+
 const guint gtk_major_version = GTK_MAJOR_VERSION;
 const guint gtk_minor_version = GTK_MINOR_VERSION;
 const guint gtk_micro_version = GTK_MICRO_VERSION;
@@ -228,6 +229,27 @@ static const guint gtk_ndebug_keys = sizeof (gtk_debug_keys) / sizeof (GDebugKey
 
 #endif /* G_ENABLE_DEBUG */
 
+gchar*
+gtk_check_version (guint required_major,
+                  guint required_minor,
+                  guint required_micro)
+{
+  if (required_major > GTK_MAJOR_VERSION)
+    return "Gtk+ version to old (major mismatch)";
+  if (required_major < GTK_MAJOR_VERSION)
+    return "Gtk+ version to new (major mismatch)";
+  if (required_minor > GTK_MINOR_VERSION)
+    return "Gtk+ version to old (minor mismatch)";
+  if (required_minor < GTK_MINOR_VERSION)
+    return "Gtk+ version to new (minor mismatch)";
+  if (required_micro < GTK_MICRO_VERSION - GTK_BINARY_AGE)
+    return "Gtk+ version to new (micro mismatch)";
+  if (required_micro > GTK_MICRO_VERSION)
+    return "Gtk+ version to old (micro mismatch)";
+  return NULL;
+}
+
+
 gint gtk_use_mb = -1;
 
 void
index 05aa261ac1e6a2d85725a3ae799fdcf00c071b73..074f7ed03f3654fda7205b249bc34d3b175e1ef1 100644 (file)
@@ -47,6 +47,9 @@ extern const guint gtk_minor_version;
 extern const guint gtk_micro_version;
 extern const guint gtk_binary_age;
 extern const guint gtk_interface_age;
+gchar* gtk_check_version (guint        required_major,
+                         guint required_minor,
+                         guint required_micro);
 
 
 /* Initialization, exit, mainloop and miscellaneous routines